var resume1;
var resume2;
var resume3;
var resume4;
var resume5;
var page1=0;

var local="http://47.104.10.151";
function onClickAjax_Resume() {
    var page=0;
    xmlHttp = createXMLHttpResume();
    var txt = "";//用于存储拼接字符串；
    var url=local+":8080/resume/findResumeAllByPage";
    //拼接字符
    txt = "page=" + page;
    xmlHttp.open("POST", url, true);
    xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlHttp.send(txt);


    xmlHttp.onreadystatechange = function () {
        if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {

            var result = xmlHttp.responseText;
            var json = eval("(" + result + ")");

            var inputre1 = document.getElementsByName("resume1");
            resume_id1 = json.data.content[0].keyId;
            inputre1[0].value = json.data.content[0].name;
            inputre1[1].value = json.data.content[0].skills;
            inputre1[2].value = json.data.content[0].area;
            inputre1[3].value = json.data.content[0].age;
            inputre1[4].value = json.data.content[0].service_area;


            var inputre2 = document.getElementsByName("resume2");
            resume_id2 = json.data.content[1].keyId;
            inputre2[0].value = json.data.content[1].name;
            inputre2[1].value = json.data.content[1].skills;
            inputre2[2].value = json.data.content[1].area;
            inputre2[3].value = json.data.content[1].age;
            inputre2[4].value = json.data.content[1].service_area;

            var inputre3 = document.getElementsByName("resume3");
            resume_id3 = json.data.content[2].keyId;
            inputre3[0].value = json.data.content[2].name;
            inputre3[1].value = json.data.content[2].skills;
            inputre3[2].value = json.data.content[2].area;
            inputre3[3].value = json.data.content[2].age;
            inputre3[4].value = json.data.content[2].service_area;

            var inputre4 = document.getElementsByName("resume4");
            resume_id4 = json.data.content[3].keyId;
            inputre4[0].value = json.data.content[3].name;
            inputre4[1].value = json.data.content[3].skills;
            inputre4[2].value = json.data.content[3].area;
            inputre4[3].value = json.data.content[3].age;
            inputre4[4].value = json.data.content[3].service_area;

            var inputre5 = document.getElementsByName("resume5");
            resume_id5 = json.data.content[4].keyId;
            inputre5[0].value = json.data.content[4].name;
            inputre5[1].value = json.data.content[4].skills;
            inputre5[2].value = json.data.content[4].area;
            inputre5[3].value = json.data.content[4].age;
            inputre5[4].value = json.data.content[4].service_area;

            var inputre6 = document.getElementsByName("resume6");
            resume_id6 = json.data.content[5].keyId;
            inputre6[0].value = json.data.content[5].name;
            inputre6[1].value = json.data.content[5].skills;
            inputre6[2].value = json.data.content[5].area;
            inputre6[3].value = json.data.content[5].age;
            inputre6[4].value = json.data.content[5].service_area;
        }

    };


    function createXMLHttpResume() {
        //使用大部分浏览器
        var xmlHttp;
        if (window.XMLHttpRequest) {
            xmlHttp = new XMLHttpRequest();
        }
        if (window.ActiveXObject) {
            xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
            if (!xmlHttp) {
                xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
            }
        }
        return xmlHttp;
    }
}


function onClickAjax_reresume() {
    var xmlHttp = createXMLHttpresume();
    var txt = "";//用于存储拼接字符串；
    //拼接字符
    txt = "page=" + page1;
    var url = local+":8080/ReqResume/findResumeBypage ";
    xmlHttp.open("POST", url, true);
    xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlHttp.send(txt);
    xmlHttp.onreadystatechange = function () {
        if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
            var result = xmlHttp.responseText;
            var json = eval("(" + result + ")");

            totalPages1 = json.data.totalPages;

            var input1 = document.getElementsByName("resume11");
            input1[0].value = json.data.content[0].name;
            input1[1].value = json.data.content[0].skills;
            input1[2].value = json.data.content[0].service_area;
            input1[3].value = json.data.content[0].money_area;


            var input2 = document.getElementsByName("resume22");
            input2[0].value = json.data.content[1].name;
            input2[1].value = json.data.content[1].skills;
            input2[2].value = json.data.content[1].service_area;
            input2[3].value = json.data.content[1].money_area;


            var input3 = document.getElementsByName("resume33");
            input3[0].value = json.data.content[2].name;
            input3[1].value = json.data.content[2].skills;
            input3[2].value = json.data.content[2].service_area;
            input3[3].value = json.data.content[2].money_area;


            var input4 = document.getElementsByName("resume44");
            input4[0].value = json.data.content[3].name;
            input4[1].value = json.data.content[3].skills;
            input4[2].value = json.data.content[3].service_area;
            input4[3].value = json.data.content[3].money_area;


            var input5 = document.getElementsByName("resume55");
            input5[0].value = json.data.content[4].name;
            input5[1].value = json.data.content[4].skills;
            input5[2].value = json.data.content[4].service_area;
            input5[3].value = json.data.content[4].money_area;


            var input6 = document.getElementsByName("resume66");
            input6[0].value = json.data.content[5].name;
            input6[1].value = json.data.content[5].skills;
            input6[2].value = json.data.content[5].service_area;
            input6[3].value = json.data.content[5].money_area;
        }
    }

    function createXMLHttpresume() {
        //使用大部分浏览器
        var xmlHttp;
        if (window.XMLHttpRequest) {
            xmlHttp = new XMLHttpRequest();
        }
        if (window.ActiveXObject) {
            xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
            if (!xmlHttp) {
                xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
            }
        }
        return xmlHttp;
    }
}





